
module.exports = http => {
    var io = require('socket.io')(http)
    require('./path')(io)

    io.on('connect', client => {
        console.log("连接成功")
        setInterval(() => {
            let ran = [Math.random() * 100 + 8, Math.random() * 100 + 8, Math.random() * 100 + 8, Math.random() * 100 + 8, Math.random() * 100 + 8, Math.random() * 100 + 8, Math.random() * 100 + 8, Math.random() * 100 + 8, Math.random() * 100 + 8]
            let list = [
                {
                    name: '安集',
                    data: ran,
                    type: 'bar',
                },
                {
                    name: '九集',
                    data: ran,
                    type: 'bar',
                },
                {
                    name: '刘集',
                    data: ran,
                    type: 'bar',
                },
                {
                    name: '黄集',
                    data: ran,
                    type: 'bar',
                },
                {
                    name: '新集',
                    data: ran,
                    type: 'bar',
                },

            ]
            client.emit('pillar', list)
        }, 3000)

        client.emit("message", "你好啊！赛利亚")
        client.on('disconnect', () => {
            console.log('断开连接')
            client.disconnect()
        })
    })
    io.on('disconnect', () => {
        console.log('断开连接')
        client.disconnect()
    })
    // 项目统计图随机



}



